package pl.ivmx.cinema;

public class FactoryDao {
	private static FactoryDao instance = null;

	private FactoryDao() {}
	public static String MOVIE = "MOVIE";
	public static String ACTOR = "ACTOR";
	public static String SHOW = "SHOW";

	public static FactoryDao getInstance() {
		if (instance == null) {
			instance = new FactoryDao();
		}
		return instance;
	}
	
	public static BaseDao getDao(String type){
		
		if(type.compareTo(MOVIE) == 0){
			return MovieDao.getInstance();
		}else if(type.compareTo(ACTOR) == 0){
			return ActorDao.getInstance();
		}else if(type.compareTo(SHOW) == 0){
			return ShowDao.getInstance();
		}else return null;
	}
}
